import pytz
from django.conf import settings

def local_str(datetime_obj):
    return local_time(datetime_obj).strftime('%Y-%m-%d %H:%M')

def local_time(datetime_obj):
    tz_name=settings.TIME_ZONE
    tmzn=pytz.timezone(tz_name)
    return datetime_obj.astimezone(tmzn)
